<!-- 奥铃官网       首页开始 -->
<!doctype html>
<html lang="en">
<head>
 {include file="public/resource" /}	
<link rel="stylesheet" href="__INDEX__/css/sign.css">
<script src="//captcha.luosimao.com/static/js/api.js"></script>
</head>
<body>
 {include file="public/header" /}	
<!-- 内容区 -->
<div id="container">
	<!-- banner -->
	<div class="swiper-container swiper-container1" style="">
	    <div class="swiper-wrapper swiper-wrapper1">
	        <div class="swiper-slide swiper-slide1"><a href=""><img src="__INDEX__/img/sign/banner.jpg" alt="" class="scale-big"></a></div>
	    </div>
	</div>
	<div class="denglu" >
		<h1>登录</h1>
		<form action="#" method="post" >
			<div class="div"><span>账号:</span><input type="text" value="" placeholder="请输入手机号" name="mobile"  id="mobile"></div>
			<span id="mobile_check" class="check">
				
			</span>

			<div class="div"><span>密码:</span><input type="password" value="" placeholder="请输入密码" name="password"  id="password"></div>
			<span id="password_check" class="check">
				
			</span>

			<div class="div" style="display: flex;align-items: center;">
				<span>随机码:</span>
				<div class="l-captcha" data-site-key="c35f80e3aeb63b54fdac9db0fd6a3f2b" data-callback="getResponse" data-width="100%" ></div>
			</div>

			<div>
				<div class="label">
					<input name="rember" type="radio" value="1"  id="rember" >记住登录状态
					<a href="{:url('Login/passreset')}">忘记密码？</a>
					<a href="{:url('Login/reg')}">注册</a>
				</div> 
			</div>

			<input type="button" value="登录" id="submit" onclick="loguser()">

		</form>
	</div>
</div>
<script>


	function loguser(){
		var phone = $("input[name='mobile']").val();
		var password = $("input[name='password']").val();
		var rember = $('input[name="rember"]:checked').val(); 
		if(rember!=1){
			rember=2;
		}
		if (phone == '') {
	        alert('请输入手机号');
	        return false;
	    }else if(password==''){
	        alert('请输入密码');
	        return false;
	    }else if (!(/^[1][3,4,5,7,8][0-9]{9}$/.test(phone))) {
            alert("请输入正确的电话号码");
            return false;
	    }else if(resps == undefined || resps == ''){
	    	alert('请进行验证');
	    	return false;
	    }

	    $.ajax({
            url: '/index/login/index',
            data: {
                phone:phone,
                password:password,
                rember:rember,
                yzm:resps
            },
            async:false,
            type: 'post',
            dataType: 'json',
            success: function callback_ver(result) {
                if(result==1){
                	alert('用户名密码为空');
                	return false;
                }else if(result==2){
                	alert('随机码验证错误');
                	return false;
                }else if(result==3){
                	alert('手机号不存在');
                	return false;
                }else if(result==4){
                	alert('密码错误');
                	return false;
                }else if(result==5){
                	alert('登录成功'); //跳转
                	window.location.href = 'http://aoling.douyar.cc/index/login/center.html';
                	return false;
                }else if(result==6){
                	alert('登录成功'); //跳转
                	window.location.href = 'http://aoling.douyar.cc/index/hd1/lm_xs1.html';
                	return false;
                }
            }
        });





	}
	var resps;
   function getResponse(resp){
  	 resps = resp;
	}
</script>
<!-- <script src="//captcha.luosimao.com/static/js/api.js"></script> -->
 {include file="public/footer" /}	
</body>
</html>